<?php

// +----------------------------------------------------------------------
// | EasyAdmin
// +----------------------------------------------------------------------
// | PHP交流群: 763822524
// +----------------------------------------------------------------------
// | 开源协议  https://mit-license.org 
// +----------------------------------------------------------------------
// | github开源项目：https://github.com/zhongshaofa/EasyAdmin
// +----------------------------------------------------------------------

namespace app\model\api;

use laytp\BaseModel;
class GenshinRecord extends BaseModel
{

    protected $deleteTime = 'delete_time';


    /**
     * 根据uid查询抽卡记录
     * @param $uid
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getRecordList($uid){
        $list = $this->field('scene,record_id,rank_type,name,time')
            ->where([
                ['uid', '=', $uid],
            ])
            ->order('record_id desc')
            ->select()
            ->toArray();

        return $list;
    }


    /**
     * 角色头像
     * @return array
     */
    public function getRoleInfo(){
        $list = (new \app\model\api\GenshinRole())
            ->column('icon,role_name,"role" as type', 'role_name');

        return $list;
    }

}